package com.otitan.la.forest.system.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 字典类型表
 *
 * @author jiacs
 * @email xxx
 * @date 2020-09-17 12:53:59
 */
@Data
@TableName("\"SYS_DIC_TYPE\"")
@ApiModel("字典类型表实体")
public class DicTypeEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 字典类型ID
     */
    @ApiModelProperty(value = "字典类型ID", required = false)
    @TableId("\"ID\"")
    private String id;

    /**
     * 菜单类型名称
     */
    @ApiModelProperty(value = "菜单类型名称", required = true)
    @NotEmpty(message = "菜单类型名称不能为空")
    @Length(max = 20, message = "菜单类型名称不能超过 20 个字符")
    @TableField("\"DIC_TYPE_NAME\"")
    private String dicTypeName;

    /**
     * 菜单类型编码
     */
    @ApiModelProperty(value = "菜单类型编码", required = true)
    @NotEmpty(message = "菜单类型编码不能为空")
    @Length(max = 32, message = "菜单类型编码不能超过 32 个字符")
    @TableField("\"DIC_TYPE_CODE\"")
    private String dicTypeCode;

    /**
     * 排序
     */
    @ApiModelProperty(value = "排序", required = true)
    @NotNull(message = "排序不能为空")
    @Max(value = 999, message = "排序不能超过 999")
    @Min(value = 0, message = "排序不能小于 0")
    @TableField("\"ORDER_NO\"")
    private Integer orderNo;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注", required = false)
    @Length(max = 80, message = "备注不能超过 80 个字符")
    @TableField("\"REMARK\"")
    private String remark;


    /**
     * 是否删除
     */
    @ApiModelProperty(value = "是否删除", required = false)
    @TableField(value = "\"IS_DELETE\"", fill = FieldFill.INSERT)
    @TableLogic  //逻辑删除注解
    @JsonIgnore  //忽略
    private Integer isDelete;

    /**
     * 创建用户
     */
    @ApiModelProperty(value = "创建用户", required = false)
    @TableField(value = "\"CREATE_USER\"", fill = FieldFill.INSERT)
    private String createUser;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间", required = false)
    @TableField(value = "\"CREATE_DATE\"", fill = FieldFill.INSERT)
    private Date createDate;

    /**
     * 编辑用户
     */
    @ApiModelProperty(value = "编辑用户", required = false)
    @TableField(value = "\"UPDATE_USER\"", fill = FieldFill.INSERT_UPDATE)
    private String updateUser;

    /**
     * 编辑时间
     */
    @ApiModelProperty(value = "编辑时间", required = false)
    @TableField(value = "\"UPDATE_DATE\"", fill = FieldFill.INSERT_UPDATE)
    private Date updateDate;
}
